package com.example.filterPattern.criteria;

import com.example.filterPattern.Person;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by youcai_dev2 on 2017/12/15.
 */
public class CriteriaMale implements Criteria {
    @Override
    public List<Person> meetCriteria(List<Person> persons) {
        List<Person> femalePersons = new ArrayList<>();
        for (Person p: persons ) {
            if("FEMALE".equalsIgnoreCase(p.getGender())){
                femalePersons.add(p);
            }
        }
        return femalePersons;
    }
}
